<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/axios.min.js"></script>
    
    <link rel="stylesheet" href="../sass/leg.css">
</head>
<body>
    <div class="wrap">
        <div class="nav">
            <div class="nav-left">
                <a href="#"><img src="../image/logo.jpg" alt=""></a>
            </div>
        <div class="nav-right">
            <div class="right-one">
                <a href="#">首页</a>
                <a href="#">分类</a>
                <a href="#">有路联盟</a>
                <a href="#">信用评价</a>
                搜索书名：
                <input type="text">
                <input type="button" value="搜索">
            </div>
            <div class="right-two">
                
                <div>
                    欢迎您，访客！
                    [<a href="#">登录</a>]
                    <a href="#">免费注册</a>
                    |
                    <a href="#">网站购物车</a>
                    |
                    <a href="#">店铺购物车</a>
                    |
                    <a href="#">我的有路</a>
                    |
                    <a href="#">客服中心</a>
                    |
                    <a href="#">帮助</a>
                </div>
            </div>
        </div>
        </div>
        <div class="lead">
            当前位置：
            <a href="#">有路网</a>&gt;&gt;
            <a href="#">我的有路</a>&gt;&gt;
            会员登陆
        </div>
    </div>
    <div class="conter">
      <div class="conter-left">
          <div class="conter-left1"><div><img src="../image/phone.png" alt=""></div></div>
           <div class="conter-left2">
            <div><img src="../image/book1.png" alt=""></div>
            <div><img src="../image/WxQrCode.jpg" alt=""></div>
            <div>扫描关注微信公众号</div>
            <div>实时获取订单动态、物流动态</div>
           </div>
      </div>
      <div class="conter-right">
          <div>
              <!-- <div>短信登录注册</div> -->
              <div>账号登录</div>
          </div>
        <div class="conter-use">
            <!-- <div>
                <div>+86</div>
                <input type="text">
                
            </div>
            <p>请填写手机号码</p>
            <div>
                <div>验证码</div>
                <input type="text">
                <span>获取验证码</span>
            </div>
            <p>请输入验证码</p> -->
            <input type="text" placeholder="邮箱">
            <input type="text" placeholder="密码">
            <input type="button"value="登录" class="yi">
        </div>
      </div>
    </div>
    <!-- 接口地址：http://jx.xuzhixiang.top/ap/api/login.php
接口请求方式：get
接口参数：
     username用户名
     password密码
使用方式
     http://jx.xuzhixiang.top/ap/api/login.php?username=11&password=1212

服务器返回json数据 -->
<script>
    let loginAPI="http://jx.xuzhixiang.top/ap/api/login.php";
    let ips=document.querySelectorAll(".conter-use input");
    ips[2].onclick=function(){
        let username= ips[0].value;
        let password= ips[1].value;
        axios.get(loginAPI,{
            params:{
                username,
                password,
            }
        }).then((r)=>{
            if(r.data.code==0){
                alert(r.data.msg);
            }else{
                // 因为后面会用到 用户名 用户id  和 token这个是令牌所以要先把他们存到本地 
                
                // 解构赋值获取值
                let {id,token,username}=r.data.data;
            console.log(id);
            console.log(token);
            console.log(username);
                // // 存入本地d
                localStorage.setItem("id",id);
                localStorage.setItem("token",token);
                localStorage.setItem("username",username);
                location.href="zynav.html";
            }
        })

          
        
    }
    var i = 10;    

setTimeout(function(){     

i--;   

i = i *2;   

},30000)   

document.write(i)
    // axios.get(regurl,{
    //     params:{
    //         username:usename,
    //         password:pw
    //     }
    // }).then((r)=>{
    //     let span=document.querySelector("span");
    //     let z=r.data.msg;
    //     console.log(z);
    //   span.innerHTML=z;
</script>
</body>
</html>